package com.mathassistant.client.event.exercise;

import com.google.gwt.event.shared.GwtEvent;
import com.mathassistant.shared.ExerciseDTO;
import com.mathassistant.shared.TopicDTO;

public class ExerciseEditEvent extends GwtEvent<ExerciseEditEventHandler>{

	public static final Type<ExerciseEditEventHandler> TYPE = new Type<ExerciseEditEventHandler>();
	private ExerciseDTO exercise;
	private TopicDTO topic;
	private int indexExercise;
	
	public ExerciseEditEvent(ExerciseDTO exercise, TopicDTO topic, int indexBeginList){
		this.exercise = exercise;
		this.topic = topic;
		this.indexExercise = indexBeginList;
	}
	
	public ExerciseDTO getExercise(){
		return exercise;
	}
	
	public TopicDTO getTopic(){
		return topic;
	}
	
	public int getIndexBeginList(){
		return indexExercise;
	}
	
	@Override
	public Type<ExerciseEditEventHandler> getAssociatedType() {
		// TODO Auto-generated method stub
		return TYPE;
	}

	@Override
	protected void dispatch(ExerciseEditEventHandler handler) {
		// TODO Auto-generated method stub
		handler.onEditExercise(this);
	}

}
